home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / QDDVX102.ZIP / contrib / dvx / inc / x11 / selectio.h < prev    next >
Text File  |  1993-07-15  |  4KB  |  126 lines

  1. /* $XConsortium: SelectionI.h,v 1.28 90/08/27 20:47:36 swick Exp $ */
  2. /* $oHeader: SelectionI.h,v 1.3 88/08/19 14:02:44 asente Exp $ */
  3. /***********************************************************
  4. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  5. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  6.  
  7.                         All Rights Reserved
  8.  
  9. Permission to use, copy, modify, and distribute this software and its 
  10. documentation for any purpose and without fee is hereby granted, 
  11. provided that the above copyright notice appear in all copies and that
  12. both that copyright notice and this permission notice appear in 
  13. supporting documentation, and that the names of Digital or MIT not be
  14. used in advertising or publicity pertaining to distribution of the
  15. software without specific, written prior permission.  
  16.  
  17. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  19. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  20. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23. SOFTWARE.
  24.  
  25. ******************************************************************/
  26.  
  27. #ifndef _XtselectionI_h
  28. #define _XtselectionI_h
  29.  
  30. #include <X11/Intrinsic.h> /* Was "Intrinsic.h". POHC 90/12/18 */
  31.  
  32. #define BYTELENGTH(length, format) ((length)*((format)>>3))
  33. #define NUMELEM(bytelength, format) ((bytelength) / ((format)>>3))
  34.  
  35. typedef struct _RequestRec *Request;
  36. typedef struct _SelectRec *Select;
  37.  
  38. typedef struct _RequestRec {
  39.    Select ctx;              /* logical owner */
  40.    Widget widget;          /* widget actually receiving Selection events */
  41.    Window requestor;
  42.    Atom property;
  43.    Atom target;
  44.    Atom type;
  45.    int format;
  46.    XtPointer value;
  47.    unsigned long bytelength;
  48.    int offset;
  49.    XtIntervalId timeout;
  50.    XSelectionRequestEvent event; /* for XtGetSelectionRequest */
  51.    Boolean allSent;
  52. } RequestRec;
  53.  
  54. typedef struct _SelectionPropRec { /* Added Tag. POHC 91/01/16 */
  55.   Atom prop;
  56.   Boolean avail;
  57. } SelectionPropRec, *SelectionProp;
  58.  
  59. typedef struct _PropListRec { /* Added Tag. POHC 91/01/16 */
  60.   Display *dpy;
  61.   Atom incremental_atom, indirect_atom, timestamp_atom;
  62.   int propCount;
  63.   SelectionProp list;
  64. } PropListRec, *PropList;
  65.  
  66. typedef struct _SelectRec {
  67.     Atom selection;             /* constant */
  68.     Display *dpy;             /* constant */
  69.     Widget widget;
  70.     Time time;
  71.     XtConvertSelectionProc convert;
  72.     XtLoseSelectionProc loses;
  73.     XtSelectionDoneProc notify;
  74.     XtCancelConvertSelectionProc owner_cancel;
  75.     XtPointer owner_closure;
  76.     PropList prop_list;
  77.     Request req;            /* state for local non-incr xfer */
  78.     int ref_count;            /* of active transfers */
  79.     Boolean incremental:1;
  80.     Boolean free_when_done:1;
  81.     Boolean was_disowned:1;
  82. } SelectRec;
  83.  
  84. typedef struct _CallBackInfoRec { /* Added Tag. POHC 91/01/16 */
  85.     XtSelectionCallbackProc callback;
  86.     XtPointer *req_closure;
  87.     Atom property;
  88.     Atom *target;
  89.     Atom type;
  90.     int format;
  91.     char *value;
  92.     int bytelength;
  93.     int offset;
  94.     XtIntervalId timeout;
  95.     XtEventHandler proc;
  96.     Widget widget;
  97.     Time time;
  98.     Select ctx;
  99.     Boolean incremental;
  100. } CallBackInfoRec, *CallBackInfo;
  101.  
  102. typedef struct _IndirectPair { /* Added Tag. POHC 91/01/16 */
  103.   Atom target;
  104.   Atom property;
  105. } IndirectPair;
  106.  
  107. #define IndirectPairWordSize 2
  108.  
  109. typedef struct _RequestWindowRec { /* Added Tag. POHC 91/01/16 */
  110.   int active_transfer_count;
  111. } RequestWindowRec;
  112.  
  113. #define MAX_SELECTION_INCR(dpy) (((65536 < XMaxRequestSize(dpy)) ? \
  114.     (65536 << 2)  : (XMaxRequestSize(dpy) << 2))-100)
  115.  
  116. #define MATCH_SELECT(event, info) ((event->time == info->time) && \
  117.         (event->requestor == XtWindow(info->widget)) && \
  118.         (event->selection == info->ctx->selection) && \
  119.         ((event->target == *info->target) || \
  120.          ((event->target == info->ctx->prop_list->incremental_atom) && \
  121.           (event->property == info->property))))
  122.  
  123.  
  124. #endif /* _XtselectionI_h */
  125. /* DON'T ADD STUFF AFTER THIS #endif */
  126.